package strategy

import (
	"github.com/go-gota/gota"
)

type PricesSeries gota.Series
type TickDf gota.DataFrame //columns :=[iid, dt, lp, v, ap, av, bp, bv,  oi,  ]
type BarDf gota.DataFrame

// 收到 tick 数据时执行
func (tdf TickDf) OnTick(t TickData)

// 收到 tick 数据时执行
func (bdf BarDf) OnTick(t TickData)

// 收到 bar 数据时执行
func (bdf BarDf) OnBar(t BarData)

type GotaStra struct {
	InstrumentID string
	Params       map[string]Param
	Variables    map[string]any
	Interval     IntervalType
	tick         TickData
	ticks        TickDf
	bar          BarData
	bars         BarDf
	OnTick       StraOnTickType
	OnTicks      StraOnTicksType
	OnBar        StraOnBarType
	OnBars       StraOnBarsType
}

func NewGotaStra(iid string, intervalType IntervalType, params map[string]Param) *GotaStra {
	gs := GotaStra{}
	gs.InstrumentID = iid
	gs.Interval = intervalType
	gs.Params = params
	gs.tick = TickData{}
	gs.bar = BarData{}

	return &gs
}
